<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
	<title>Log4Qt</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<link HREF="default.css" TYPE="text/css" REL="STYLESHEET" >
</head>
<body>
<h1>Log4Qt</h1>
<h2>Introduction</h2>
<p>
Log4Qt is a C++ port of the Apache Software Foundation Log4j package using the 
Trolltech Qt Framework. It is intended to be used by open source and commercial
Qt projects.
</p>

<h2>Documentation</h2>
<p>
The documentation describes classes and methods that have been added or changed
compared to Log4j. The documentation was generated from the source code using 
Doxygen. It can be accessed <a href="html/index.html">here</a>.
</p>

<h2>How to use</h2>
<p>
To use Log4Qt within your software project include the Log4Qt source into your project
<ol>
	<li>
	Download the package from the 
	<a href="https://sourceforge.net/project/showfiles.php?group_id=212208">SourceForge project page</a>
	</li><li>
	Unpack the Log4Qt package
	</li><li>
	Add the log4qt source to the Qt project file by adding the following line<br>
	<code>include(&lt;unpackdir&gt;/src/log4qt/log4qt.pri)</code>
	</li><li>
	Include the Logger class, a layout and an appender class to configure Log4Qt to generate output. The example uses the ConsoleAppender with a TTCCLayout<br>
	<code>include "log4qt/consoleappender.h"</code><br>
	<code>include "log4qt/logger.h"</code><br>
	<code>include "log4qt/ttcclayout.h"</code>
	</li><li>
	Configure a logger to generate output. The example uses the root logger<br>
	<code>// Create a layout</code><br>
	<code>Log4Qt::LogManager::rootLogger();</code><br>
	<code>TTCCLayout *p_layout = new TTCCLayout();</code><br>
	<code>p_layout->setName(QLatin1String("My Layout"));</code><br>
	<code>p_layout->activateOptions();</code><br>
	<code>// Create an appender</code><br>
	<code>ConsoleAppender *p_appender = new ConsoleAppender(p_layout, ConsoleAppender::STDOUT_TARGET);</code><br>
	<code>p_appender->setName(QLatin1String("My Appender"));</code><br>
	<code>p_appender->activateOptions();</code><br>
	<code>// Set appender on root logger</code><br>
	<code>Log4Qt::Logger::rootLogger()->setAppender(p_appender);</code>
	</li><li>
	Request a logger by either calling Log4Qt::Logger::logger or using LOG4QT_DECLARE_QCLASS_LOGGER<br>
	<code color="green">// Request a logger and output "Hello World!"</code><br>
	<code>Log4Qt::Logger::logger(QLatin1String("My Logger"))->info("Hello World!");</code><br>
   	</li>
</ol>
</p>

<h2>Releases</h2>
<p>
<ul>
	<li>
	<b>0.3 - 01 March 2009</b><br>
	Bug fixes, compatibility with VS 2008 and Qt 4,5 RC1
	<ul>
		<li>
		Fixed a problem where the pParent parameter of the constructor was not passed on to the QObject constructor (logobject.h)
		</li>
		<li>
		Fixed a problem were OptionConverter::toBoolean would not return the default value, if the conversion fails (optionconverter.cpp)
		</li>
		<li>
		Fixed a compile error on VS 2008 by using Q_UNUSED(&rEvent) instead of Q_UNUSED(rEvent) (varia/denyallfilter.h.h)
		</li>
		<li>
		Fixed VS 2008 unreferenced formal parameter warning by using Q_UNUSED (logmanager.cpp, mdc.cpp, ndc.cpp, propertyconfigurator.cpp, helpers/initialisationhelper.cpp, helpers/patternformatter.cpp)
		</li>
	</ul>
	</li>
	<li>
	<b>0.2 - 30 January 2009</b><br>
	Bug fixes and compatibility with Qt 4.4
	<ul>
		<li>
		Added a compile time version check for the Qt version (log4qt.h)
		</li>
		<li>
		Replaced usage of q_atomic_increment and q_atomic_decrement with QAtomicInt for compilation with Qt 4.4 (helpers/logobject.h)
		</li>
		<li>
		Replaced usage of q_atomic_test_and_set_ptr with QAtomicPointer for compilation with Qt 4.4 (logger.h, helpers/classlogger.cpp, helpers/classlogger.h, helpers/initialisationhelper.h)
		</li>
		<li>
		Fixed a problem with Qt 4.4 where QReadWriteLock is by default non-recursive (hierarchy.cpp, logger.cpp)
		</li>
		<li>
		Resolved compilation problem with Microsoft Visual Studio 2005 (logmanager.cpp, helpers/datetime.cpp)
		</li>
	</ul>
	</li>
	<li>
	<b>0.1 - 29 December 2007</b><br>
    Initial Version
	</li>
</ul>
</p>

<h2>Known Problems</h2>
<p>
<ul>
	<li>
	The Eclipse CDT console does not display the log output of a correctly
	when using a ConsoleAppender with a TTCCLayout and relative time format. 
	The millisecond count is stripped from the output.
	</li>
</ul>
</p>

<h2>License</h2>
<p>
Log4Qt is licensed under the 
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</a>.
</p>
<p>
Log4Qt requires the Qt framework that is available under several licensing options
(<a href="http://www.qtsoftware.com/products/appdev/licensing/licensing">Qt licensing</a>).
The package is intended to be used under the 
<a href="http://doc.trolltech.com/4.4/license-gpl-exceptions.html">Nokia Corporation Qt GPL Exception</a>.
</p>

<h2>Links</h2>
<p>
<ul>
	<li>The <a href="http://logging.apache.org/log4j">log4j</a> project</li>
	<li>The <a href="http://logging.apache.org/log4cxx">logcxx</a> project</li>
	<li>The <a href="http://log4cplus.sourceforge.net">log4cplus</a> project</li>
	<li>The <a href="http://log4c.sourceforge.net">log4c</a> project</li>
	<li><a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></li>
</ul>
</p>

<p>
<br>
<table width="100%">
	<tr >
		<td><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=212208&amp;type=4" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a></td>
		<td align="right">XX February 2009, Martin Heinrich</td>
	</tr>
</table>
</p>

</html>
